import { GET_HOTSONGS_SUCCESS, HotSongsUnionActionType, IPlaylistResult } from "../actions/hotsongs.action";

const initialState: IPlaylistResult = {
  updateTime : 0,
  tracks: []
}

export default function hotSongsReducer (state = initialState, action: HotSongsUnionActionType) {
  switch (action.type) {
    case GET_HOTSONGS_SUCCESS:
      return action.payload.playlist
    default:
      return state
  }
}